package com.axjy.service.impl;

import com.axjy.mapper.UserMapper;
import com.axjy.pojo.User;
import com.axjy.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class UserServicelmpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    @Transactional(readOnly = true)
    public List<User> list() {
        return userMapper.findAll();
    }

    @Override
    public void update(User user) {
        userMapper.update(user);
    }

    @Override
    public void add(User user) {
        userMapper.add(user);
    }

    @Override
    public void del(Integer id) {
        userMapper.del(id);
    }

    @Override
    public void batchDel(Integer[] ids) {
        userMapper.batchDel(ids);
    }
}
